#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <climits>

using namespace std;


int main(){

    vector<string> sv;
    string s;
    int cnt=0;
    while(cin >> s){
        sv.push_back(s);
        if(s.find("7")!=string::npos){
            cnt++;
            continue;
        }
        if(stoi(s)%7==0){
             cnt++;
        }
    }
    cout << cnt <<endl;



    return 0;
}